package com.clk.portfoy.screens;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URI;
import java.net.URISyntaxException;

import javax.swing.border.EtchedBorder;

import com.clk.desktop.gui.components.basic.ClkFrame;
import com.clk.desktop.gui.components.basic.ClkLabel;
import com.clk.desktop.gui.components.basic.ClkPanel;
import com.clk.portfoy.PortfoyStatics;

public class ScrAbout extends ClkFrame {

	private class LblProAddressMouseListener extends MouseAdapter {
		public void mouseClicked(final MouseEvent e) {
			do_lblProAddress_mouseClicked(e);
		}
	}

	private class LblIconMouseListener extends MouseAdapter {
		public void mouseClicked(final MouseEvent e) {
			do_lblIcon_mouseClicked(e);
		}
	}

	private ClkLabel projectPageClkLabel;
	private ClkLabel lblProAddress;
	private ClkPanel clkPanel_1;
	private ClkPanel clkPanel;
	private ClkLabel lblIcon;
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// ---------------------------------------------------------------------------------
	public ScrAbout() {
		super();
		initGUI();
		setSize(new Dimension(463, 89));
		lblIcon.setIcon(PortfoyStatics.imgCLK);
	}
	// ---------------------------------------------------------------------------------
	private void initGUI() {
		System.currentTimeMillis();
		{
			clkPanel = new ClkPanel();
			clkPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
			clkPanel.setLayout(null);
			clkPanel.setBounds(0, 0, 461, 86);
			getContentPane().add(clkPanel);
			{
				lblIcon = new ClkLabel();
				lblIcon.addMouseListener(new LblIconMouseListener());
				lblIcon.setBounds(10, 10, 129, 65);
				clkPanel.add(lblIcon);
			}
			{
				clkPanel_1 = new ClkPanel();
				clkPanel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
				clkPanel_1.setLayout(null);
				clkPanel_1.setBounds(145, 10, 309, 65);
				clkPanel.add(clkPanel_1);
				{
					lblProAddress = new ClkLabel();
					lblProAddress.setForeground(new Color(0, 0, 255));
					lblProAddress.addMouseListener(new LblProAddressMouseListener());
					lblProAddress.setText("http://code.google.com/p/clk-portfoy/");
					lblProAddress.setBounds(87, 0, 215, 20);
					clkPanel_1.add(lblProAddress);
				}
				{
					projectPageClkLabel = new ClkLabel();
					projectPageClkLabel.setText("Project Page:");
					projectPageClkLabel.setBounds(0, 0, 81, 20);
					clkPanel_1.add(projectPageClkLabel);
				}
			}
		}
	}

	// ---------------------------------------------------------------------------------
	protected void do_lblIcon_mouseClicked(final MouseEvent e) {
		this.dispose();
	}

	// ---------------------------------------------------------------------------------
	protected void do_lblProAddress_mouseClicked(final MouseEvent e) {
		try {
			PortfoyStatics.openURI(new URI(lblProAddress.getText()));
			this.dispose();
		} catch (URISyntaxException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	// ---------------------------------------------------------------------------------
}
